﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace D.B.Data.Infrastructuse
{
    public class BaseRepository<T> : IBaseRepository<T> where T : class
    {
        private readonly DataDbContext Db;

        public BaseRepository(DataDbContext db)
        {
            Db = db;
        }

        public IQueryable<T> GetAll()
        {
            return Db.Set<T>().AsQueryable();
        }

        public int UpData(T entity)
        {
             Db.Set<T>().Update(entity);

            return Db.SaveChanges();
        }
    }
}
